#include <stdio.h>
 
 unsigned long getl(int n)
 {
     unsigned long result=0;
     unsigned long r=n;
     while(r>1)
     {
         if(r%2==0)
         {
             r/=2;
             result++;
             continue;
         }
         if(r%2==1)
         {
             r=r*3+1;
             result++;
             continue;
         }
     }
     return(result);
 }
 
int main()
 {
     int i,j,k;
     int m,n;
     unsigned long max=0,temp;
     while(scanf("%d %d",&i,&j)!=EOF)
     {
         max=0;
         m=i>j?j:i;
         n=i>j?i:j;
         for(k=m;k<=n;k++)
         {
             temp=getl(k);
             if(temp>max)
                 max=temp;
         }
         printf("%d %d %ld\n",i,j,max+1);
    }
}

